package com.njwt.cloud.mszuul.exception;

import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author <a href="mailto:xingxiao@gtmap.cn">xingxiaofeng</a>
 * @version2.1 2022-04-12
 * @description
 */
@RestController
public class ExceptionHandler implements ErrorController {

    /***
     * 返回处理限流异常的路径
     */
    @Override
    public String getErrorPath() {
        // TODO Auto-generated method stub
        return "error";
    }

    /***
     * 自定义方法对异常进行处理
     */
    @RequestMapping("/error")
    public String error() {
        return "{\"result\":\"访问太多频繁，请稍后再访问！！！\"}";
    }



}

